package org.wattdepot.cli.command;

import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Test that checks for valid output within the TotalPowerCommand class.
 * 
 * @author Anthony Xu & John Mack
 * 
 */

public class TestTotalCarbon {
  


    /**
     * Test to see if totalpower displays correct output for carbon statistic 60.
     * 
     * @throws Exception NotAuthorizedException, ResourceNotFoundException, BadXmlException,
     * MiscClientException.
     */
    @Test
    public void testCarbon() throws Exception {
      CommandLineInterface cli = new CommandLineInterface();
      List<String> commands = new ArrayList<String>();
      commands.add("total");
      commands.add("carbon");
      commands.add("SIM_KAHE_5");
      commands.add("day");
      commands.add("2009-10-31");
      commands.add("sampling-interval");
      commands.add("60");

      String carbon = new ListTotalCommand().doCommand(cli, commands);
      assertEquals("correct carbon output","Carbon: 3610343.5377777778", carbon);

    }

}
